<template>
    <div ref="body">
        <Form :label-width="120" inline>
            <Form-item label="属地区划:">
                <area-linkage :areaCode.sync="queryParam.ssca0043"></area-linkage>
            </Form-item>
            <Form-item label="人员姓名:">
                <Input v-model="queryParam.azcp0003" placeholder="请输入户主姓名" style="width:200px"/>
            </Form-item>
            <Form-item label="户主身份证号码:">
                <Input v-model="queryParam.azcp0001" placeholder="请输入户主身份证号码" style="width:200px"/>
            </Form-item>

            <Form-item label="发放年月:">
                <DatePicker type="month" placeholder="请选择发放年月" v-model="queryParam.ssfa0002Time"
                            style="width: 200px"  :editable="false"></DatePicker>
            </Form-item>
            <Form-item label="是否本地户籍:">
                <c-dict-select v-model="queryParam.azdf0505" dictCode="yesorno" :width="200"/>
            </Form-item>
            <Form-item label="联系人类型:">
                <c-dict-select v-model="queryParam.azdf0510" dictCode="contact_type" :width="200"/>
            </Form-item>
            <Form-item label="联系人姓名:">
                <Input v-model="queryParam.azdf0511" placeholder="请输入联系人姓名" style="width:200px"/>
            </Form-item>

            <Row class="button_row">
                  <span style="float: left;margin-left: 8px">
                 <Button type="primary" icon="ios-cloud-download-outline"
                         @click="exportExcelNew">临时救助花名册导出</Button>
                     </span>
                <span style="float: right;margin-right: 8px">
                 <Button type="primary"  @click="searchQueryNew">查询</Button>
                 <Button type="primary" class="button_item_left" @click="searchReset">重置</Button>
                     </span>
            </Row>
        </Form>
        <div class="table_div">
            <vxe-table border
                       resizable
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       highlight-hover-row
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :data="tableData">
                <vxe-table-column field="ssca0043" title="属地区划" align="center" min-width="220" fixed="left"
                                  :formatter="renderAreaName"/>
                <vxe-table-column field="azcp0003" title="户主姓名" align="center" min-width="100" fixed="left"/>
                <vxe-table-column field="azcp0001" title="身份证号码" align="center" min-width="200" fixed="left"/>
                <vxe-table-column field="azdf0505_name" title="是否本地户籍" align="center" min-width="150"/>
                <vxe-table-column field="ssfa0002" title="发放年月" align="center" min-width="150" :formatter="Time1"/>
                <vxe-table-column field="azdf0503_name" title="家庭类别" align="center" min-width="150"/>
                <vxe-table-column field="azdf0509_name" title="申请类型" align="center" min-width="150"/>
                <vxe-table-column field="ssca0051" title="家庭人口" align="center" min-width="100"/>
                <vxe-table-column field="azdf0510_name" title="联系人类型" align="center" min-width="100"/>
                <vxe-table-column field="azdf0511" title="联系人姓名" align="center" min-width="100"/>
                <vxe-table-column field="azdf0010" title="联系电话" align="center" min-width="150"/>
                <vxe-table-column field="ssca0013_name" title="困难原因" align="center" min-width="150"/>
                <vxe-table-column field="ssca0006" title="批准时间" align="center" min-width="100" :formatter="renderTime"/>
                <vxe-table-column field="ssca0026" title="批准金额" align="center" min-width="100"/>
                <vxe-table-column field="ssca0009_name" title="开户银行" align="center" min-width="150"/>
                <vxe-table-column field="ssca0010" title="银行账户" align="center" min-width="100"/>
                <vxe-table-column field="ssca0011" title="银行账号" align="center" min-width="200"/>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"></Page>
        </div>

    </div>
</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'

    export default {
        name: "list",
        mixins: [CommonMixin],
        components: {},
        data() {
            return {
                queryParam: {},
                exportFileName: "临时救助花名册导出",
                Loading: true,
                url: {
                    list: "/api/ac/subsistence/ss18101Service/page",
                    exportExcel: "/api/ac/subsistence/ss18101Service/export",
                },
            }
        },
        methods: {
            searchQueryNew() {
                if (this.queryParam.ssfa0002Time) {
                    this.queryParam.ssfa0002 = this.DateFormat(this.queryParam.ssfa0002Time, 'YYYY-MM') + "-01";
                }else{
                    this.queryParam.ssfa0002 =null;
                }
                this.searchQuery();
            },
            exportExcelNew() {
                if (this.queryParam.ssfa0002Time) {
                    this.queryParam.ssfa0002 = this.DateFormat(this.queryParam.ssfa0002Time, 'YYYY-MM') + "-01";
                    this.exportExcel();
                } else {
                    this.$Message.error("请选择发放年月！");
                }

            }
        },
        created() {
            this.findAreaList();
        }
    }
</script>

<style scoped>

</style>